from socket import *

host = '192.168.1.106'
port = 8899
bufsize = 2048
addr = (host,port)

TcpClient = socket(family=AF_INET, type=SOCK_STREAM)
TcpClient.connect(addr)

buffer=[]
while True:
    # data = input('>:')
    # if not data:
    #     break
    # TcpClient.send(data.encode())
    data = TcpClient.recv(bufsize)
    buffer.extend(data)
    if not data:
        break
    print(len(data))

TcpClient.close()




